\documentclass[dvipsnames]{article}
% \documentclass[dvipsnames]{ctexart}
\title{weak-chain memo}



\usepackage{geometry}\geometry{
  a4paper,
  total={170mm,257mm},
  left=20mm,
  top=20mm,
}

\usepackage{tabularray}
\UseTblrLibrary{booktabs,siunitx}

\usepackage{adjustbox}          %to narrower the caption
\newlength\mylength
% \usepackage{hyperref}
\usepackage{svg}
\usepackage[skip=5pt plus1pt, indent=0pt]{parskip}
\usepackage{emoji}
% \setemojifont{NotoColorEmoji.ttf}[Path=C:/Users/congj/repo/myFonts/]
% \setemojifont{TwitterColorEmoji-SVGinOT.ttf}[Path=C:/Users/congj/repo/myFonts/]

\usepackage{booktabs}

\input{h-lua}
\date{\today}
\author{HiAaa}
\tcbuselibrary{breakable}
\newtcolorbox{blackbox}{tile,colback=black,colupper=white,nobeforeafter,halign=flush center}

\newcommand{\mycolaa}{\mycola!20}

\usepackage{placeins}

% \usepackage{lscape}             %for landscape env
\usepackage{pdflscape} %uncomment this  and comment above line to see the difference
% --------------------------------------------------

\usepackage{tabularx}



\begin{document}
\maketitle
\tableofcontents{}
\newpage{}

% \input{2024-01-23}
% \input{2024-01-30}
% \input{2024-02-11}
\input{2024-03-05}

\section*{2024-03-11}

\emoji{parrot} :  Okay, let's try writing a python vm executor.

\emoji{turtle} : Great, first, let's talk about the interface.

\emoji{parrot} : Let's say

\begin{simplec}
tuple<bool, string> execute_py_tx(string_view py_contract, string_view abi, int timeout_s = 2);
\end{simplec}

\emoji{turtle} : What's the return value?

\emoji{parrot} : I am thinking the first one is the success or not, the second
one is the error message, or the result. The second string is something should
be put into the \texttt{TxReceipt}.

\emoji{turtle} : What's would the return value be when things go well?

\emoji{parrot} : I think

\begin{simplejs}
{
    "result" : 1
    "log" : "Here is some log printed by the methods"
}
\end{simplejs}

The result can be any json object.

And when things go wrong, it would be
\begin{simplejs}
{
    "error" : "Here are some error messages"
}
\end{simplejs}

\emoji{turtle} : Oh, so the boolean return value can acutally be inferred from
the json object right?

\emoji{parrot} : Yes, but I think it's better to have a boolean return
value.(just for convenience)

\section*{2024-03-11}

\emoji{parrot} : Finally, let's try the pyExecutotor

\section*{2024-03-29}
\emoji{parrot} : Let's write the Serious executor. But I think there should be
two things to be done:
\begin{enumerate}
\item We need to verify the Tx, and derive the \texttt{.from} field from it's
  pk. 
\end{enumerate}

% It turns out that windows terminal has some issues displaying the stderr of
% our py-vm ? Commenting out the log lines seems to fix the issue... Mysterious
% windows... Now we got some issues for the storageManager on windows..

\section*{2024-05-10}
\emoji{parrot} : I just feel like people need a \texttt{get\_tx?hash=xxxxxxx}.
Currently we kinda have to remember which Blk it's in and then find the tx by
getting the blk. It's not very convenient.

\emoji{turtle} : But I remember the \texttt{<tx-hash> : TxOnBlkInfo} is directly
persisted right? Is that available to the user in rpc?

\emoji{parrot} : Let me check.....Oh... When we do \texttt{get\_receipt}, in
fact, we first retrieved the \texttt{TxOnBlkInfo info}, and then we get the
corresponding \texttt{ExecBlk b}, and then we get the
\texttt{b.txReceipts[info.onBlkId]}...

\emoji{turtle} : Okay... Let's add two more apis:

\begin{enumerate}
\item \texttt{get\_tx?hash=xxxxxxx}
\item \texttt{get\_Blk?n=123}
\end{enumerate}

\end{document}

% Local Variables:
% TeX-engine: luatex
% TeX-command-extra-options: "-shell-escape"
% TeX-master: "m.tex"
% TeX-parse-self: t
% TeX-auto-save: t
% End:
